How to...

# Hack GFIE using the built-in scripting feature [BETA]

You can automate Greenfish Icon Editor Pro by writing PascalScript scripts. GFIE has been developed in Free Pascal, using the Lazarus IDE. You can run your own scripts written in PascalScript, which can then access almost all the classes, functions and types defined in GFIE, to augment the editor with almost any functionality.

Warning: Scripts can cause GFIE to crash, access your hard disk, access the internet, and do much more, causing potential data and privacy loss. By running scripts you declare that you are responsible for any damage these scripts may cause to you or others.

You will need to study the source code of GFIE first. You will find it in the src.7z archive file supplied with GFIE. Then you can use Filters|Scripting to bring up the script editor. Write your PascalScript code here, which has to look like a Pascal program. Then select Run|Run to execute your script.

The following global variables are accessible from scripts:

- Application: TApplication
- frmMain: TfrmMain

You may use the Writeln function to log to the console. In contrast to standard Pascal, this version of Writeln accepts only a single string-typed argument. You may use IntToStr and the like to convert integers to strings.

Warning: Virtual constructors are currently not supported and generate various error messages.